home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / CC_C / 0574.ZIP / FPRINTF.ASM < prev    next >
Assembly Source File  |  1986-11-20  |  581b  |  41 lines

  1. include compiler.inc
  2.  
  3.     ttl    FPRINTF, 1.05, 10-20-86 jwk
  4.  
  5.  
  6. ;formatted print to file
  7.  
  8.     dseg
  9.  
  10.     defptr    strm            ;saves stream pointer
  11.  
  12.     cseg
  13.  
  14.     xtfs    <_fmt, putc>
  15.  
  16.     procdef    fprintf, <<fp, ptr>, <arglst, word>>
  17.  
  18.     pushreg
  19.     pushds
  20.     ldptr    di, fp        ;set up file pointer
  21.     svptr    di, strm
  22.     mov    ax, offset pc        ;pointer to function
  23.     lea    dx, arglst    ;adr of first arg
  24.     callit    _fmt, <<dx, preg, ss>, <ax, preg, cs>>
  25.     pret
  26.  
  27.     pend    fprintf
  28.  
  29.     statdef    pc, <<chr, byte>>
  30.  
  31.     mov    al, chr
  32.     xor    ah, ah
  33.     callit    putc <<strm, ptr, dx>, <ax, reg>>
  34.     pret
  35.  
  36.     iend    pc
  37.  
  38.     finish
  39.  
  40.     end
  41.